import React from 'react'
import {Consumer} from '../GlobalContext'
class Son extends React.Component{
    render() {
        return <Consumer>
            {
                (ctxData) => {
                    console.log(123, ctxData)
                    return <div>
                        孙子{ctxData.name}
                        <button onClick={() => ctxData.yeyeFn('我是孙子给你传的数据')}>孙子的按钮</button>
                    </div>
                }
            }
        </Consumer>
    }
}
export default Son